package com.CMS.server.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import com.CMS.server.domain.Privilege;

public class PrivilegeDao extends BaseDao<Privilege> {

	public PrivilegeDao(){
		super();
	}
	
	@SuppressWarnings("unchecked")
	public List<Privilege> getAll(){
		EntityManager em = entityManager();
		List<Privilege> lista = null;
		try
		{
			Query q = em.createQuery("select p from Privilege p");
			lista = q.getResultList();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally{
			em.close();
		}
		
		return lista;
	}
}
 